import { get, post } from "./http.js"

// =======================菜单管理================
// 添加
export const menuAdd = (params) => post("/api/menuadd", params)
//列表
export const menuList = (params) => get("/api/menulist", params)
//删除
export const menuDel = (params) => post("/api/menudelete", params)
//获取一条
export const menuInfo = (params) => get("/api/menuinfo", params)
//编辑
export const menuEdit = (params) => post("/api/menuedit", params)

// =======================角色管理================
//添加
export const roleAdd = (params) => post("/api/roleadd", params)
//列表
export const roleList = () => get("/api/rolelist")
//删除
export const roleDel = (params) => post("/api/roledelete", params)
// 获取一条
export const roleInfo = (params) => get("/api/roleinfo", params)
// 编辑
export const roleEdit = (params) => post("/api/roleedit", params)

// =======================管理员管理================
// 添加
export const manageAdd = (params) => post("/api/useradd", params)
// 列表
export const manageList = (params) => get("/api/userlist", params)
// 管理员总数
export const manageCount = () => get("/api/usercount")
// 删除
export const manageDel = (params) => post("/api/userdelete", params)
// 获取一条
export const manageInfo = (params) => get("/api/userinfo", params)
// 编辑
export const manageEdit = (params) => post("/api/useredit", params)
// 登录
export const login = (params)=> post("/api/userlogin",params)

// =======================商品分类================
// 商品分类添加
export const cateAdd = (params) => post("/api/cateadd", params, true)
// 商品分类列表
export const cateList = (params) => get("/api/catelist", params)
// 商品分类获取(一条)
export const cateInfo = (params) => get("/api/cateinfo", params)
// 商品分类修改
export const cateEdit = (params) => post("/api/cateedit", params, true)
// 商品分类删除
export const cateDel = (params) => post("/api/catedelete", params)

// =======================商品规格================
// 规格添加
export const specsAdd = (params) => post("/api/specsadd", params)
// 规格总数
export const specsCount = () => get("/api/specscount")
// 规格列表
export const specsList = (params) => get("/api/specslist", params)
// 规格获取(一条)
export const specsInfo = (params) => get("/api/specsinfo", params)
// 规格修改
export const specsEdit = (params) => post("/api/specsedit", params)
// 规格删除
export const specsDel = (params) => post("/api/specsdelete", params)

// =======================商品管理================
// 商品添加
export const goodsAdd = (params) => post("/api/goodsadd", params, true)
// 商品总数
export const goodsCount = () => get("/api/goodscount")
// 商品列表
export const goodsList = (params) => get("/api/goodslist", params)
// 商品获取(一条)
export const goodsInfo = (params) => get("/api/goodsinfo", params)
// 商品修改
export const goodsEdit = (params) => post("/api/goodsedit", params, true)
// 商品删除
export const goodsDel = (params) => post("/api/goodsdelete", params)

// =======================轮播图管理================
// 轮播图添加
export const bannerAdd = (params) => post("/api/banneradd", params, true)
// 轮播图列表
export const bannerList = () => get("/api/bannerlist")
// 轮播图获取(一条)
export const bannerInfo = (params) => get("/api/bannerinfo", params)
// 轮播图修改
export const bannerEdit = (params) => post("/api/banneredit", params, true)
// 轮播图删除
export const bannerDel = (params) => post("/api/bannerdelete", params)

// =======================会员管理================
// 会员列表
export const memberList = () => get("/api/memberlist")
// 会员获取(一条)
export const memberInfo = (params) => get("/api/memberinfo",params)
// 会员修改
export const memberEdit = (params) => post("/api/memberedit",params)

// =======================限时秒杀================
// 活动添加
export const seckillAdd = (params) => post("/api/seckadd", params)
// 活动列表
export const seckillList = () => get("/api/secklist")
// 活动获取(一条)
export const seckillInfo = (params) => get("/api/seckinfo",params)
// 活动修改
export const seckillEdit = (params) => post("/api/seckedit", params)
// 活动删除
export const seckillDel = (params) => post("/api/seckdelete", params)